/*
 * @Author: 李明明
 * @Date: 2021-03-29 17:03:09
 * @LastEditTime: 2021-03-29 17:08:18
 * @LastEditors: 李明明
 * @Description: 添加时间戳
 * @FilePath: /zhufeng_egg.js_2103/egg-example/app/middleware/servertime.js
 * '
 */
'use strict';

module.exports = (options, app) => {
  return async (ctx, next) => {
    console.log(app);
    if (options.isIndex === ctx.url) {
      ctx.set('X-Server-Time', Date.now());
    }
    await next();
  };
};
